<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    
        //ES6 定义变量的解构赋值

        // let a = 10,
        //     b = 20,
        //     c = 30;
        
        // let [a, b, c] = [10, 20, 30];

        // console.log(a);

        // function fn() {
        //     let x = [];
        //     for(let i=0;i<5;i++) {
        //         x[i] = i * i;
        //     }
        //     return x;
        // }
        // let [a,b,c,d,e] = fn();


        // let {a:x, b:y} = {a:10, b:20};
        // console.log(x, y);


        // let {x:x, y:y} = {y:10, x:20};
        // let {x, y} = {y:5, x:10};
        // console.log(x, y);



        let a = 10;
        let b = 20;
        let c = {
            a:a,
            b:b,
            x:20
        };
        console.log(c); 

    </script>
</body>
</html>